<?php

declare (strict_types=1);
namespace App\Models\GameDB\LotteryTurntable;

use App\Models\MainDB\Gift;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
 * @property int $id 
 * @property int $reward_id 
 * @property string $reward_type 
 * @property Carbon $created_at
 * @property Carbon $updated_at
 */
class LotteryTurntablePrize extends Model
{
    protected $connection = 'mysql_game';
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'lottery_turntable_prize';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    // protected $fillable = [];
    protected $guarded = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'reward_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function getDateFormat(): string
    {
        return 'Y-m-d H:i:s.u';
    }

    public function reward(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne(Gift::class, "id", "reward_id");
    }

    public function seat(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(LotteryTurntableSeat::class, "id","prize_id");
    }
}